package com.library.entity;

import javax.persistence.*;

/**
 * Created by mhy on 2018/1/6.
 */
@Entity
@Table(name="payment")
public class Payment {
    private Integer paymentId;       //缴费记录ID
    private Staff staff;            //员工
    private Book book;              //书
    private Float money;           //金额
    private Administrator admin;     //处理的管理员
    private String date;           //时间
    private Integer reason;        //1表示超期 2表示书籍丢失


    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    public Integer getPaymentId() {
        return paymentId;
    }

    public void setPaymentId(Integer paymentId) {
        this.paymentId = paymentId;
    }

    @ManyToOne(cascade=CascadeType.PERSIST)
    @JoinColumn(name="staffId")
    public Staff getStaff() {
        return staff;
    }

    public void setStaff(Staff staff) {
        this.staff = staff;
    }

    public Float getMoney() {
        return money;
    }

    public void setMoney(Float money) {
        this.money = money;
    }

    @ManyToOne(cascade=CascadeType.PERSIST)
    @JoinColumn(name="adminId")
    public Administrator getAdmin() {
        return admin;
    }

    public void setAdmin(Administrator admin) {
        this.admin = admin;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public Integer getReason() {
        return reason;
    }

    public void setReason(Integer reason) {
        this.reason = reason;
    }

    @ManyToOne(cascade=CascadeType.PERSIST)
    @JoinColumn(name="bookId")
    public Book getBook() {
        return book;
    }

    public void setBook(Book book) {
        this.book = book;
    }
}
